package com.shigu.appVersion.action;

import com.shigu.appVersion.bo.VersionRequest;
import com.shigu.appVersion.service.VersionService;
import com.shigu.appVersion.vo.DownLoadResponse;
import com.shigu.appVersion.vo.SomethingResponse;
import com.shigu.appVersion.vo.VersionResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

/*
 * create by  过儿  2019-06-19
 * 版本相关控制层
 */
@RequestMapping("wapsjson")
@Controller
public class VersionController {

    @Autowired
    VersionService versionService;

    @ResponseBody
    @RequestMapping("getAppUpdate")
    public VersionResponse getAppUpdate(VersionRequest request){
        return versionService.getAppUpdate(request.getVersion(),request.getOs());
    }

    @ResponseBody
    @RequestMapping("getDownloadUrl")
    public DownLoadResponse getDownloadUrl(){
        return versionService.getDownloadUrl();
    }

    @ResponseBody
    @RequestMapping("getSomethingInfo")
    public SomethingResponse getSomethingInfo(VersionRequest request){
        return versionService.something(request.getVersion(),request.getOs());
    }
}
